<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>预览--个性化定制</title>
        <include file="public/comm" />
	</head>

	<body>
		<if !empty($err)><center>{$err}</center><else>
		<header class="mui-bar mui-bar-nav fs_xl">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left fs_xxi"></a>
			<h1 class="mui-title fs_xl">预览</h1>
		</header>
		<!--下方导航-->
		<div class="mui-content fs_xl" style="overflow: hidden;">
			<div class="dz_m yl_m">
				<img class="dz_bgimg active" src="__STATIC__/images/pingzi.png" />
				<div class="dz_bk dz_m_js active"></div>
				<div class="dz_up" id="preview">
					<div id="ddd" style=" width:100%;position: absolute;top:0;left:0">
						<img src="" />
					</div>
				</div>
				<!--图片上传-->
				<div class="yl_wz">
					<img src="__STATIC__/images/anli.png" />
					<span class="yc_yl"></span>
				</div>
			</div>
			<div class="yl_dd">
				<span>¥56/瓶</span>
				<span class="fs_m">购买数量:
				<div class="mui-numbox fs_m" data-numbox-min='30'>
					<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
					<input class="mui-input-numbox" type="number" style="vertical-align: top;" />
					<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
				</div></span>
				<span class="fs_xs">30瓶起订</span>
			</div>
			<div class="yl_nav">
				<a class="yl_res">重新定制</a>
				<a class="yl_gw">加入购物车</a>
				<a class="yl_gm">立即购买</a>
			</div>
		</div>
		<script>
			mui.init();
			var winW = $("body").width();
			var liW = (winW - 1) / 2;
			var winH = $("body").height();
			var dzH = winH - $("header").height() - $(".yl_nav").height() - 1;
			$(".dz_m").height(dzH);
			$(".pz_xz,.bk_xz").width(liW);

			$.urlParam = function(name){
    			var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
    			return results[1] || 0;
			}
			
			$(function() {
//				var imgU = $.urlParam('imgurl');
				var dz_Wz = $.urlParam('wz_d');
				$(".yc_yl").text(decodeURI(dz_Wz));
//				var image=$.urlParam('img');
				var imgObjPreview=$.urlParam('imgurl');
				$("#ddd img").attr("src",imgObjPreview);
			})

			function uploadImage() {
				$.ajax({
					type: 'POST',
					url: 'ajax/uploadimage',
					data: { image: image },
					async: false,
					dataType: 'json',
					success: function(data) {
						if(data.success) {
							alert('上传成功');
						} else {
							alert('上传失败');
						}
					},
					error: function(err) {
						alert('网络故障');
					}
				});
			}
		</script>
		</else></if>
	</body>

</html>